package FileIO;

import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
import org.w3c.dom.Document;

public enum DocumentoXML {
	INSTANCE;

	private Document documento;

	private DocumentoXML(){
		try {
			DocumentBuilderFactory laberintoXML = DocumentBuilderFactory.newInstance();
			DocumentBuilder docBuilder = laberintoXML.newDocumentBuilder();

			documento = docBuilder.newDocument();
		}catch(ParserConfigurationException e){
			e.printStackTrace();
		}
	}

	public Document getDocumentoXML(){	
		return this.documento;
	}
	
	public void limpiarDocumento(){
		documento.removeChild(documento.getFirstChild());
	}

}